"use strict";
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
    for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
        to[j] = from[i];
    return to;
};
exports.__esModule = true;
var PDF_config_1 = require("./PDF.config");
var PDFInsuranceInstituationalClaim = /** @class */ (function () {
    function PDFInsuranceInstituationalClaim() {
    }
    PDFInsuranceInstituationalClaim.prototype.getPDFDefinition = function (claim) {
        var newClaim = __assign(__assign({}, PDF_config_1.constantData), claim);
        var dbDocDefinitionTemp = [];
        var chargesDbDocDefinitionTemp = [];
        newClaim.charges.forEach(function (item, chargeIndex) {
            Object.keys(item).forEach(function (key) {
                chargesDbDocDefinitionTemp.push({
                    text: item[key],
                    noWrap: true,
                    style: 'style',
                    absolutePosition: {
                        x: (PDF_config_1.chargesDocConfig[key]),
                        y: (928 + chargeIndex * 51) * 0.250
                    }
                });
            });
        });
        var docDefinitionTemp = Object.keys(PDF_config_1.pdfConfig).map(function (key) {
            if (!!PDF_config_1.pdfConfig[key][3]) {
                dbDocDefinitionTemp.push({
                    text: newClaim[key],
                    noWrap: true,
                    style: 'style',
                    absolutePosition: {
                        x: PDF_config_1.pdfConfig[key][2],
                        y: PDF_config_1.pdfConfig[key][3]
                    }
                });
            }
            return {
                text: newClaim[key],
                noWrap: true,
                style: 'style',
                absolutePosition: {
                    x: PDF_config_1.pdfConfig[key][0],
                    y: PDF_config_1.pdfConfig[key][1]
                }
            };
        });
        var docDefinition = {
            content: __spreadArray(__spreadArray(__spreadArray([
                {
                    image: './ub04-1.jpg',
                    width: 595,
                    height: 842,
                    absolutePosition: { x: 0, y: 0 }
                }
            ], docDefinitionTemp), dbDocDefinitionTemp), chargesDbDocDefinitionTemp),
            styles: {
                style: {
                    fontSize: 8
                }
            }
        };
        return docDefinition;
    };
    return PDFInsuranceInstituationalClaim;
}());
exports["default"] = PDFInsuranceInstituationalClaim;
